﻿private "_unit";
_unit = _this select 0;
if (count _this > 1) then {
	_unit removeAction (_this select 2);
	if (alive _unit) then {
		private "_array";
		_array = _unit getVariable "var_group_vip";
		if (_array select 0) then {
			_array set [0,false];
			_unit setvariable ["var_group_vip",_array,true];
			[_unit] join (_array select 1);
		} else {
			_array set [0,true];
			_unit setvariable ["var_group_vip",_array,true];
			[_unit] join group (_this select 1);
		};
		_null = _unit addAction [Localize "STR_R3F_SCENE_VIP" call R3F_FNCT_Blue,"tmf\core\modules\r3f_acv\Scripts\SCENE_vip.sqf",[],1,false,false,"","(((_this distance _target) < 7) && (alive _target))"];
	};
} else {
	_unit setvariable ["var_group_vip",[false,group _unit],true];
	[nil,_unit,"per",rADDACTION,((Localize "STR_R3F_SCENE_VIP") call R3F_FNCT_Blue),"tmf\core\modules\r3f_acv\Scripts\SCENE_vip.sqf",[],5,false,false,"","(((_this distance _target) < 7) && (alive _target))"] call RE;
};
